package com.ynnydemo07;
/**
 * 创建一个Java类`Student`，包含私有属性`name`、`age`和`grade`三个属性，完成它的公共方法、无参、有参构造器，
 * 以及一个`toString`方法用于显示学生的信息。
 */

public class Student {
    private String name;

    private int age;

    private String grade;

    public Student() {
    }



    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }


    public String getGrade() {
        return grade;
    }

    public void setGrade(String grade) {
        this.grade = grade;
    }

    public Student(String grade) {
        this.grade = grade;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", grade=" + grade +
                '}';
    }
}
